//
//  XMMeetEvaluateViewController.m
//  XMJJ_zml
//
//  Created by 丁浩 on 2025/6/23.
//

#import "XMMeetEvaluateViewController.h"
#import "XMMeetEvaluateView.h"
#import "XMNetwork+mine.h"

@interface XMMeetEvaluateViewController ()

@property (nonatomic, strong) XMMeetEvaluateView *evaluateView;

@end

@implementation XMMeetEvaluateViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self creatUI];
}

- (void)creatUI {
    [self.view addSubview:self.evaluateView];
    [_evaluateView setContentWithOrderDetailModel:self.orderDetailModel];
}

- (void)evaluateConfirmWithParameters:(NSDictionary *)parameters {
    XMWeakSelf;
    [_Network evaluateConfirmWithParameters:parameters
                                    success:^(id  _Nonnull responseObject) {
        [MBProgressHUD showSuccess:@"评价成功"];
        [weakSelf.navigationController popViewControllerAnimated:YES];
    } failure:^(NSError * _Nonnull error) {
        
    }];
}

#pragma mark - Init
- (XMMeetEvaluateView *)evaluateView {
    if (!_evaluateView) {
        _evaluateView = [[XMMeetEvaluateView alloc] initWithFrame:self.view.bounds];
        XMWeakSelf;
        _evaluateView.confirmBlock = ^(NSDictionary * _Nonnull parameters) {
            [weakSelf evaluateConfirmWithParameters:parameters];
        };
    }
    return _evaluateView;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
